package com.angel.service.ServiceImpl;

import com.angel.bean.AppInfo;
import com.angel.bean.CmsInfo;
import com.angel.mapper.AppInfoDao;
import com.angel.mapper.CmsInfoDao;
import com.angel.service.AppInfoService;
import com.angel.service.CmsInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class AppInfoServiceImpl implements AppInfoService {

    @Resource
    private AppInfoDao appInfoDao;

    @Override
    public int insert(AppInfo appInfo){
        return appInfoDao.insert(appInfo);
    }

    @Override
    public int insertSelective(AppInfo appInfo){
        return appInfoDao.insertSelective(appInfo);
    }

    @Override
    public int insertList(List<AppInfo> appInfo){
        return appInfoDao.insertList(appInfo);
    }

    @Override
    public int update(AppInfo appInfo){
        return appInfoDao.update(appInfo);
    }

    @Override
    public List<AppInfo> findAll(AppInfo appInfo) { return appInfoDao.findAll(appInfo);}

    @Override
    public AppInfo findOne(AppInfo appInfo){

            List<AppInfo> list = this.findAll(appInfo);
            if(list == null || list.isEmpty() ){
                    return null;
            }
            return list.get(0);
    }

    @Override
    public List<AppInfo> findAllStart(AppInfo appInfo) {
        return appInfoDao.findAllStart(appInfo);
    }
}
